/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 jfinal app. jfapp Group.
 */

package app.models.info;

import app.models.DaoKit;
import com.github.sog.annotation.TableBind;
import com.github.sog.controller.datatables.core.DatatablesCriterias;
import com.github.sog.plugin.sqlinxml.SqlKit;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

import java.util.List;

/**
 * <p>
 * The table olb_floor mapping model.
 * </p>
 */
@TableBind(tableName = "olb_floor")
public class Floor extends Model<Floor> {

    /**
     * The public dao.
     */
    public static final Floor dao = new Floor();

    private static final long serialVersionUID = 1L;

    public List<Floor> list() {
        return find(SqlKit.sql("floor.list"));
    }

    public Page<Record> datatable(DatatablesCriterias criterias) {
        return DaoKit.paginate("floor", criterias);
    }

    public List<Floor> findByNotParking() {
        return find(SqlKit.sql("floor.findByNotParking"), false);
    }
}